<?Lassoscript
// Last modified 1/3/11 by Eric Landmann

/* This software is covered by the Creative Commons Attribution license
	See http://creativecommons.org/licenses/by/3.0/
	For the purposes of this license, the following apply:
		Original Author: Eric Landmann
		Licensor: Eric Landmann
		Work: The software included in this distribution known as "Lfor"
		Description: A Lasso-powered Forums Application
	Communication regarding this license, contact Eric Landmann <elandmann@gmail.com>
*/

// USAGE
// Make appropriate changes. Examples are given.
// This file assumes the application will be set up in a folder named /forums.
// It can be set up anywhere on a site, just make sure to change the $svDomain
// and $svSiteFolderRoot variables

// CHANGE NOTES
// 9/22/09
// Version 1.0
// 12/9/09
// Replaced FCKEditor with ckeditor
// Changed $svAdmin_Email to $svAdminEmail
// 1/3/11
// Added check for devel site and switch to devel database. Started syntax conversion.

// Check for devel site, look for leading "dev" in site name
Var('svIsDevelSite' = boolean);
(Server_Name)->(BeginsWith('dev')) ? $svIsDevelSite = true | $svIsDevelSite = false;

// Debugging
Var('svDebug' = 'N');

// Session Variables
Var('svSessionName' = 'forums',
	'svSessionTimeout' = 9660,
	'svSessionAdminName' = 'forums_admin',
	'svSessionAdminTimeout' = 1440);

// Define Databases & User Authentication
Var('svSiteDatabase' = 'Lfor',
	// If no separate devel database, make sure this is the same as $svSiteDatabase
	'svDevelDatabase' = 'Lfor',
	// We are using the same user ID and password for both databases
	'svSiteUsername' = 'Lfor',
	'svSitePassword' = '#topsecret_password!');

// Set database name
// If we're on the devel site, use the dev database, otherwise use the live one
If($svIsDevelSite == true);
	$svSiteDatabase = $svDevelDatabase;
	// Accept Debug as an action_param
	Var('svDebug' = Action_Param('Debug'));
/If;

// Table Names
Var('svAdminTable' = 'Forums_Admin',
	'svStatsTable' = 'forums_stats',
	'svSectionsTable' = 'forums_sections',
	'svTopicsTable' = 'forums_topics',
	'svPostsTable' = 'forums_posts',
	'svMembersTable' = 'forums_members',
	'svErrorsTable' = 'forums_errors',
	'svNotifyTable' = 'forums_notify',
	'svImagesTable' = 'forums_images');

// PassThru Username and Password
Var('svPassThruUsername' = 'upload_user');
Var('svPassThruPassword' = 'upload');

// Used to determine if we want to archive the original upload file
// If so, files are renamed and moved to that path
Var('svArchiveOriginalUpload' = true);

// Path to ImageMagick, we are using the version in the Lasso folder
// Double quotes are necessary due to spaces in filepath
Var('svPathToIM' = '"/ImageMagick-6.5.0/bin/"');

// Path to the webserver root
// In order for this to work, there must be a symlink in the root of the server that links to /Library/Webserver/Documents/thevirtualhostdirectory
If($svIsDevelSite == true);
	Local('svWebserverRoot' = '/Library/Webserver/Documents/devel.thevirtualhostname');
Else;
	Local('svWebserverRoot' = '/Library/Webserver/Documents/thevirtualhostname');
/If;
// Domain names
If($svIsDevelSite == true);
	Var('svDomain' = 'devel.thevirtualhostname');
	Var('svHomeDomain' = 'devel.thevirtualhostname');
Else;
	Var('svDomain' = 'thevirtualhostname');
	Var('svHomeDomain' = 'thevirtualhostname');
/If;
// Common Name
Var('svSiteCommonName' = 'Lfor');
// Site Owner Name and Address
Var('svSiteOwner' = '');

// SMTP Server
// Var('svSMTP' = 'smtp.yourserver.com',
Var('svSMTP' = '',
	'svAuthUsername' = '',
	'svAuthPassword' = '');

// Administrator E-mail address
Var('svAdminEmail' = '');
// Postmaster E-mail address
Var('svPostmasterEmail' = '');
// Developer E-mail address
Var('svDevelEmail' = '');

// Admin E-mail notices On
Var('svAdminEmailOn' = 'Y');

// E-mail Signature
Var('svEmailSig' = '');

// Use Captcha - Not used yet
Var('svUseCaptcha' = false);

// System resource paths
// NOTE: About $svSiteFolderRoot
// If the Forums are put in a subfolder below the website root, set this to that folder
// If put in the website root, leave it an empty string
Var('svSiteFolderRoot' = '/forums',
	'svLibsPath' = (($svSiteFolderRoot)+'/site/libs/'),
	'svFCKEditorPath' = (($svSiteFolderRoot)+'/site/ckeditor/'),
	'svImagesPath' = (($svSiteFolderRoot)+'/images/'),
	'svImagesThmbPath' = (($svSiteFolderRoot)+'/images/thumb/'),
	'svImagesLargePath' = (($svSiteFolderRoot)+'/images/large/'),
	'svJSPath' = (($svSiteFolderRoot)+'/site/js/'),
	'svCssPath' = (($svSiteFolderRoot)+'/site/css/'),
	'svSmileysPath' = (($svSiteFolderRoot)+'/site/images/smileys/'),
	'svPathToFonts' = (($svWebserverRoot)+($svSiteFolderRoot)+'/fonts/'));

// Design and Content Variables
Var('svTopicHeaderColor' = '#727272',
	'svTopicContentColor' = '#F0F0E6',
	'svTopicFooterColor' = '#C9C9C9',
	'svSearchGridHLColor1' = '#D2E2D2',
	'svSearchGridHLColor2' = '#E6E6E6',
	'svPostHeaderColor' = '#7D775C',
	'svPostContentColor' = '#F0F0E6',
	'svSearchHeaderColor' = '#727272',
	'svSearchContentColor' = '#CCCCCC',
	'svNavbarColor' = '#f0f1f1',
	'svAdminNavbarColor' = '#f0f1f1');

//  Used on forms to show input is required	
Var('svInputRequired' = '&nbsp;<font color="#FF3300"><strong>&loz;</strong></font>');

// Define the namespace
Var('svCTNamespace' = 'LI_');

// Inline Variables
// Search Admin
Var('IV_SearchAdmin'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svAdminTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords=1,
		-Search='')));

// Search Stats
Var('IV_SearchStats'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svStatsTable,
		-KeyField='Section_ID',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-Search='')));
// Update Stats
Var('IV_UpdateStats'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svStatsTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-SQL='')));
// Search Posts
Var('IV_SearchPosts'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svPostsTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-Search='')));
// Search Members
Var('IV_SearchMembers'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svMembersTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-SQL='')));
// Update Posts
Var('IV_UpdatePosts'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svPostsTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-SQL='')));
// Search Sections
Var('IV_SearchSections'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svSectionsTable,
		-KeyField='Section_ID',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-SQL='')));
// Add Section
Var('IV_AddSection'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svSectionsTable,
		-KeyField='Section_id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-Add='')));
// Update Sections
Var('IV_UpdateSections'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svSectionsTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-SQL='')));
// Add Topic
Var('IV_AddTopic'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svTopicsTable,
		-KeyField='Topic_id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-Add='')));
// Search Topics
Var('IV_SearchTopics'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svTopicsTable,
		-KeyField='Topic_id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords='All',
		-Search='')));
// Update Topics
Var('IV_UpdateTopics'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svTopicsTable,
		-KeyField='Topic_id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-MaxRecords=1,
		-SQL='')));
// Add Post
Var('IV_AddPost'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svPostsTable,
		-KeyField='Post_ID',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-SQL='')));
// Images
Var('IV_Images'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svImagesTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-SQL='')));
// Search Notify
Var('IV_SearchNotify'=
	(Array( 
		-Database=$svSiteDatabase, 
		-Table=$svNotifyTable,
		-KeyField='id',
		-Username=$svSiteUsername,
		-Password=$svSitePassword,
		-SQL='')));

// Header Variables
Var('svSys_Language' = 'en-us');
Var('svSys_Expires' = '10 days');
Var('svSys_Revisit' = '10 days');
Var('svSys_Robots' = 'index, follow');
Var('svSys_Author' = 'Test author');
Var('svSys_Copyright' = ('Copyright &copy;'+((Date:(Server_Date))->Year)+' somebody'));
Var('svSys_Description' = 'Test description');
Var('svSys_Keywords' = 'Test keywords');

// Default page title
Var('vPage_Title' = (($svSiteCommonName) ' Forums'));

// Errors
Var('vError' = string);
Var('vOption' = string);

?>